﻿Imports System.IO

Namespace Maaharaa
    Public Class dvGrammar

        Dim title As String = "Grammar"
        Dim tList As New Dictionary(Of String, String)
        Public suggestions() As String = Nothing
        Dim line As String
        Dim found As Boolean
        Dim Path As String = "Dictionaries/div_Grammar.div"

        Public Sub New()
            tList.Clear()
            found = False

            'search for the word...
            Try
                Dim sr As New StreamReader(Path)
                Do While sr.Peek() >= 0
                    line = sr.ReadLine
                    Dim templine As String() = line.Split("|")
                    tList.Add(templine(0), templine(1))
                Loop
                sr.Dispose()
            Catch ex As Exception
                MsgBox(ex.ToString, MsgBoxStyle.Exclamation, title)
            End Try
        End Sub

        Public Function getsuggestion() As String()
            Return suggestions
        End Function

        Public Function returnlist() As Dictionary(Of String, String)
            Return tList
        End Function
    End Class
End Namespace

